import java.util.Arrays;

public class Test {

    //数组得拷贝
    public static void main(String[] args) {
        int[] arr= new int[]{1,2,3};
        //int[] acc= Arrays.copyOf(arr,3);
        int[]acc=new int[3];
        System.arraycopy(arr,0,acc,0,3);
        System.out.println(Arrays.toString(acc));

        int[] akk =arr.clone();
        akk[0]=10;
        System.out.println(Arrays.toString(akk));
        System.out.println(Arrays.toString(arr));


    }
    public static void main2(String[] args) {

        int[] arr= new int[]{9,8,7,6,5,4,3,2,1};
        for(int i =0;i<arr.length-1;i++){
            for (int j =0;j< arr.length-1-i;j++){

                if(arr[j]>arr[j+1]){
                    int tmp= arr[j];
                    arr[j]=arr[j+1];
                    arr[j+1]=tmp;
                }
            }
        }

        for(int x:arr){
            System.out.println(x+" ");
        }
       // System.out.println(Arrays.toString(arr));
    }
}
